<?php
/**
 * Automatic discovery of files containing passed class
 *
 * @param string $className Name of a class
 */
function __autoload($className) {
    if(!is_file(str_replace('_', DIRECTORY_SEPARATOR, $className) . ".php")) throw new Exception('Cannot find class ' . $className);
    require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . ".php";
}
?>